package com.atxiaodei.javajuc.jucdemo;

/**
 * @author wangmeng
 * @date 2020/9/19
 **/
class ThreadDemo implements Runnable {

	private  volatile boolean flag = false;

	@Override
	public void run() {

		try {
			Thread.sleep(200);
		} catch (InterruptedException e) {
		}

		flag = true;

		System.out.println("flag=" + isFlag());

	}

	public boolean isFlag() {
		return flag;
	}

	public void setFlag(boolean flag) {
		this.flag = flag;
	}

}
